import { PhaseTaskTreeResolverService } from './phase-task-tree-resolver.service';
import { PhaseTaskDetailResolverService } from './phase-task-detail-resolver.service';
import { PhaseTaskDetailComponent } from './phase-task-detail/phase-task-detail.component';
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

import { PhaseTaskOverviewComponent } from './phase-task-overview/phase-task-overview.component';
import { PhaseTaskAddPageComponent } from './phase-task-add-page/phase-task-add-page.component';

const routes: Routes = [
  { path: '', redirectTo: 'overview', pathMatch: 'full' },
  { path: 'overview', component: PhaseTaskOverviewComponent },
  { path: 'add', component: PhaseTaskAddPageComponent },
  {
    path: 'detail/:id',
    component: PhaseTaskDetailComponent,
    resolve: {
      task: PhaseTaskDetailResolverService,
      treeView: PhaseTaskTreeResolverService,
    }
  },
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule]
})
export class PhaseTaskRoutingModule { }
